package com.lm.location.action;

import com.lm.location.dao.LocationDao;

public class EditLocation extends LocationAction{

	public String updateLocation() throws Exception {		
		System.out.println("edited location................"+getName());
		Location location = getLocationDetails();
		LocationDao locDao = new LocationDao();
		locDao.updateLocation(location);
		return SUCCESS;
	}
	
	public String getlocationToEdit() throws Exception {		
		System.out.println("edited location................"+getName());
		Location location = getLocationDetails();
		LocationDao locDao = new LocationDao();
		Location locationToEdit = locDao.getlocationToEdit(getLocationID());
		setGetLocationToEdit(locationToEdit);
		//setLocationID(locationToEdit.getLocationID());
		setLocationCode(locationToEdit.getLocationCode());
		setName(locationToEdit.getName());
		setCategory(locationToEdit.getCategory());
		setAddress(locationToEdit.getAddress());
		setBlock(locationToEdit.getBlock());
		setDistrict(locationToEdit.getDistrict());
		setState(locationToEdit.getState());
		setCountry(locationToEdit.getCountry());
		setLandarea(locationToEdit.getLandarea());
		setLandterm(locationToEdit.getLandterm());
		setLandtype(locationToEdit.getLandtype());
		setRunningft(locationToEdit.getRunningft());
		setCoveredarea(locationToEdit.getCoveredarea());
		setRegisteredname(locationToEdit.getRegisteredname());
		setRegisterationno(locationToEdit.getRegisterationno());
		setRegistereddate(locationToEdit.getRegistereddate());
		setSubregistrar(locationToEdit.getSubregistrar());
		setEstvalue(locationToEdit.getEstvalue());
		setStmpexp(locationToEdit.getStmpexp());
		setOtherexp(locationToEdit.getOtherexp());
		setRegholder(locationToEdit.getRegholder());
		setRegcopy(locationToEdit.getRegcopy());
		setBuildingmap(locationToEdit.getBuildingmap());
		setCanteenOption(locationToEdit.getCanteenOption());
		setLndmark(locationToEdit.getLndmark());
		setDistance(locationToEdit.getDistance());
		setResponsible(locationToEdit.getResponsible());
		setStatus(locationToEdit.getStatus());
		setBalance(locationToEdit.getBalance());
		System.out.println("location name-----: "+locationToEdit.getName());
		return SUCCESS;
	}
	
	
}
